from django.db import models


# Create your models here.

class Book(models.Model):
    no = models.CharField(max_length=50, unique=True, verbose_name="书籍编号")
    name = models.CharField(max_length=200, verbose_name="书名")
    author = models.CharField(max_length=100, verbose_name="作者")
    created_at = models.DateTimeField(auto_now_add=True, verbose_name="创建时间")

    def __str__(self):
        return self.name

    class Meta:
        verbose_name = "书籍"
        verbose_name_plural = "书籍"
